package development;

import java.util.Hashtable;

import javax.microedition.lcdui.Graphics;

import state.GameConstants;
import state.GameForm;
import state.GameGlobal;
import state.font.FontManager;
import state.font.ImageText;

public class FrmChatRoom extends GameForm {
  private ImageText text8;

  public void init(Hashtable parameters) {
    manager.setBackGroundColor(0x440000);
    
    text8 = FontManager.getFont(FontManager.FONT_SIZE_8);
  }
  
  public void draw(Graphics g) {
    // Draw bottom bar
    g.setColor(0x2B0102);
    g.fillRect(0, GameConstants.SCREEN_HEIGHT - 25, GameConstants.SCREEN_WIDTH, 25);
    
    // Draw top bar
    g.setColor(0x2B0102);
    g.fillRect(0, 0, GameConstants.SCREEN_WIDTH, 25);
    
    if (Global.currentChatRoom != null) {
      text8.drawString(g, "Phòng chat " + Global.currentChatRoom.getTitle(), GameConstants.SCREEN_WIDTH / 2, 2, GameConstants.TOP_HCENTER_ANCHOR);
    }
    
  }

  public void keyReleased(int keyCode) {
    GameGlobal.nextState(Global.frmListRoom, null);
  }
  
  protected void destroy() {
  }
}
